package mailgod;

import processing.core.*;

public class PointLayer {
	  PVector[] pointsOutInSpace;
	  PVector[] pointsInInSpace;
	  PVector[] pointsInInPlane;
	  PVector[] pointsOutInPlane;
	  int[] setID;
	  int[] shapeID;
	  int pointCount;
	  
	  public PointLayer () {
	pointCount = 0;
	  }
	  
	 
	  public void addPoint(PVector thePointInInSpace, PVector thePointOutInSpace, PVector thePointInInPlane,PVector thePointOutInPlane, int theSetID, int theShapeID) {
	    if (shapeID == null) {
	      pointsInInSpace = new PVector[1];
	      pointsOutInSpace = new PVector[1];
	      pointsOutInPlane = new PVector[1];
	      pointsInInPlane = new PVector[1];
	      setID = new int[1];
	      shapeID = new int[1];

	    pointsInInSpace[0] = thePointInInSpace;
	    pointsOutInSpace[0] = thePointOutInSpace;
	    pointsOutInPlane[0] = thePointOutInPlane;
	    pointsInInPlane[0] = thePointInInPlane;
	    setID[0] = theSetID;
	    shapeID[0] = theShapeID;
	    } 
	    else {
	      pointsInInSpace = (PVector[])PApplet.append(pointsInInSpace,thePointInInSpace);
	      pointsOutInSpace = (PVector[])PApplet.append(pointsOutInSpace,thePointOutInSpace);
	      pointsInInPlane = (PVector[])PApplet.append(pointsInInPlane,thePointInInPlane);
	      pointsOutInPlane = (PVector[])PApplet.append(pointsOutInPlane,thePointOutInPlane);
	      setID = (int[])PApplet.append(setID,theSetID);
	      shapeID = (int[])PApplet.append(shapeID,theShapeID);
	  pointCount++;
	    }
	  }
	  
	   public void clearPoints() {
	     pointsInInSpace = null;
	pointsOutInSpace = null;
	pointsOutInPlane = null;
	pointsInInPlane = null;
	setID = null;
	shapeID = null;
	pointCount = 0;
	 }
}